package com.share.bean.attach.advertise;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.share.commons.enumeration.AdvertisEnum;

/**
 * <p>
 * Title：图片和动画广告
 * </p>
 * <p>
 * Description：
 * </p>
 * 
 * @Author：杨浩泉
 * @Date：2010-4-24
 */
@Entity
@Table(name = "share_adMultiMeadia")
public class AdvertiseMultimedia {

	/** 广告内容ID */
	private int adContentId;

	/** 广告图片或动画路径 */
	private String adPath;

	/** 图片或动画宽度（像素） */
	private int width;

	/** 图片或动画高度（像素） */
	private int height;

	/** 广告超链接地址 */
	private String adLink;

	/** 广告超链接提示 */
	private String adLinkAlt;

	/** 超链接的打开目标 */
	private AdvertisEnum adLinkTarget = AdvertisEnum._BLANK;

	/** 透明度 */
	private String adTransparence;
 
	/** 广告简介 */
	private String adBrief;

	/** 文本广告内容与广告列表一对一关联关系，被维护 */
	private Advertise advertisement;

	@OneToOne(mappedBy = "adMultimedia", cascade = CascadeType.REFRESH)
	@JoinColumn(name = "adMultimedia_id")
	public Advertise getAdvertisement() {
		return advertisement;
	}

	public void setAdvertisement(Advertise advertisement) {
		this.advertisement = advertisement;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE)
	public int getAdContentId() {
		return adContentId;
	}

	public void setAdContentId(int adContentId) {
		this.adContentId = adContentId;
	}

	public String getAdPath() {
		return adPath;
	}

	public void setAdPath(String adPath) {
		this.adPath = adPath;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public String getAdLink() {
		return adLink;
	}

	public void setAdLink(String adLink) {
		this.adLink = adLink;
	}

	public String getAdLinkAlt() {
		return adLinkAlt;
	}

	public void setAdLinkAlt(String adLinkAlt) {
		this.adLinkAlt = adLinkAlt;
	}


	public String getAdTransparence() {
		return adTransparence;
	}
	
	@Enumerated(EnumType.STRING)
	public AdvertisEnum getAdLinkTarget() {
		return adLinkTarget;
	}

	public void setAdLinkTarget(AdvertisEnum adLinkTarget) {
		this.adLinkTarget = adLinkTarget;
	}

	public void setAdTransparence(String adTransparence) {
		this.adTransparence = adTransparence;
	}

	public String getAdBrief() {
		return adBrief;
	}

	public void setAdBrief(String adBrief) {
		this.adBrief = adBrief;
	}
}
